/**
 * Created with JetBrains WebStorm.
 * User: shaoshuai
 * Date: 12-8-7
 * Time: 下午9:40
 */
var fs = require('fs');
var parse = function (file) {
    var content = fs.readFileSync(file, 'utf-8').split('\n');
    var retObject = {};
    content.forEach(function (element) {
        element = element.trim();
        if (element.charAt(0) !== '#') {
            element = element.split(/\s+/);
            element.forEach(function (e, i, array) {
                if (i > 0) {
                    retObject[e] = array[0];
                }
            });
        }
    });
    return retObject;
};
module.exports = parse(__dirname + '/mime.types');
